<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="masterPage.xhtml">
	
	<ui:define name="titulo">
		<h:outputLabel value="Calendário Google" />
		<input id="pagina" type="hidden" value="eventoCalendario"/>
	</ui:define>
	
	<ui:define name="centro">
		<f:view contentType="text/html">
			
			<h:form>

			    <p:growl id="messages" showDetail="true" />
			
			    <p:schedule value="#{scheduleController.eventModel}" widgetVar="myschedule" locale="pt">
			
			        <p:ajax event="dateSelect" listener="#{scheduleController.onDateSelect}" update="eventDetails" oncomplete="eventDialog.show()" />
			        <p:ajax event="eventSelect" listener="#{scheduleController.onEventSelect}" update="eventDetails" oncomplete="eventDialog.show()" />
			        <p:ajax event="eventMove" listener="#{scheduleController.onEventMove}" update="messages" />
			        <p:ajax event="eventResize" listener="#{scheduleController.onEventResize}" update="messages" />
			
			    </p:schedule>
			
			    <p:dialog widgetVar="eventDialog" header="Evento" showEffect="clip" hideEffect="clip">
			        <h:panelGrid id="eventDetails" columns="2">
			            <h:outputLabel for="title" value="Título" />
			            <p:inputText id="title" value="#{scheduleController.event.title}" required="true"/>
			
			            <h:outputLabel for="from" value="Data" />
			            <p:inputMask id="from" value="#{scheduleController.event.startDate}" mask="99/99/9999">
			                <f:convertDateTime pattern="dd/MM/yyyy" />
			            </p:inputMask>
			        </h:panelGrid>
			    </p:dialog>
			
			</h:form>
			
			
		</f:view>
	</ui:define>
	
</ui:composition>

</html>